The Elder Scrolls Forums

TES Construction Set and Plugins >> General TES Construction Set

Pages: 1
highpressure
Curate

Reged: 09/16/02
Posts: 870
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
Scripting Help Please!
      #2894290 - 08/06/04 12:21 PM

I need help adding lines of script to an item that is equipped by the PC that will make the item go back into his inventory after a certain amount of time.

What I'm doing is I made a Helm that allows my vampire to be a daywalker, but I only want him to be able to wear the helm for 6-7 daylight hours, and when the time is up the helm goes back into the inventory and cannot be worn again until the set hours of daylight.

I've been reading SFD by Ghan, and have everything else working up to this point, but now I'm just lost. In other words, I just can't figure out how to do the above. I've been trying since yesterday, and didn't really want to bother anyone here, but now I need help!

Anyone who can help I would really appreciate it. Thanks in advance!

--------------------
Highpressure's Morrowind
Honoring Mods & Mod-Makers




Post Extras: Print Post   Remind Me!   Notify Moderator  
highpressure
Curate

Reged: 09/16/02
Posts: 870
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
Re: Scripting Help Please! [Re: highpressure]
      #2896823 - 08/07/04 01:07 AM

Well maybe I can get some help if I display what I already have. Here is the script. I just need to know how and where to but what I need help with as described above.



begin _vampire_Dome

short OnPCEquip
short ItemEquipped



if ( OnPCEquip == 1 )


if ( MenuMode == 1 )
return
else
If (PCVampire == 1 )
if ( ItemEquipped == 0 )
FadeOut, 0.25
MessageBox "You can now walk beneath the sun's rays with no fear of pain"
Player-> RemoveSpell "Vampire sun damage"
set ItemEquipped to 1
FadeIn, 5
endif
endif
endif
else
if ( MenuMode == 1 )
return
else
if ( ItemEquipped == 1 )
FadeOut, 0.25
MessageBox " Beware! The sun's rays will now scorch you"
Player-> AddSpell "Vampire sun damage"
set ItemEquipped to 0
FadeIn, 5
endif
endif
endif
end



--------------------
Highpressure's Morrowind
Honoring Mods & Mod-Makers




Post Extras: Print Post   Remind Me!   Notify Moderator  
sisco
Curate

Reged: 02/13/03
Posts: 463
Re: Scripting Help Please! [Re: highpressure]
      #2897082 - 08/07/04 02:41 AM

This should work.

Code:

begin _vampire_Dome

short OnPCEquip
short ItemEquipped
short ItemUnequipTime



if ( OnPCEquip == 1 )


if ( MenuMode == 1 )
return
else
If (PCVampire == 1 )
if ( ItemEquipped == 0 )
set ItemUnequipTime to ( GameHour + 6 ) ; can change number to however many hours you want
FadeOut, 0.25
MessageBox "You can now walk beneath the sun's rays with no fear of pain"
Player-> RemoveSpell "Vampire sun damage"
set ItemEquipped to 1
FadeIn, 5
endif
endif
endif
else
if ( MenuMode == 1 )
return
else
if ( GameHour >= ItemUnequipTime )
if ( ItemEquipped == 1 )
FadeOut, 0.25
MessageBox " Beware! The sun's rays will now scorch you"
Player-> AddSpell "Vampire sun damage"
set ItemEquipped to 0
set ItemUnequipTime to 0
FadeIn, 5
endif
endif
endif
endif
end



--------------------
my site

Me and my friends need more active members on our forums. it's not morrowind related. just a place for total randomness. Come join and post a lot.

Post Extras: Print Post   Remind Me!   Notify Moderator  
highpressure
Curate

Reged: 09/16/02
Posts: 870
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
Re: Scripting Help Please! [Re: sisco]
      #2897546 - 08/07/04 07:05 AM


sisco....A BIG THANK YOU!

I just knew if I waited it out the MW community would come through. As small as that line is, to a novice trying to learn this is huge. Again thank you soooo much!








--------------------
Highpressure's Morrowind
Honoring Mods & Mod-Makers




Post Extras: Print Post   Remind Me!   Notify Moderator  
highpressure
Curate

Reged: 09/16/02
Posts: 870
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
Re: Scripting Help Please! [Re: sisco]
      #2898212 - 08/07/04 12:54 PM

Well it didn't work afterall, but I did learn something here and that's very good. I know that I'm closer than I was before. Would I need to use a PCSkipEquip command anywhere to get this to work?

Anyone? Please!

Thanks again for the help sisco. Believe it, or not I gained some much need scripting knowledge with that small amount of info.

--------------------
Highpressure's Morrowind
Honoring Mods & Mod-Makers




Post Extras: Print Post   Remind Me!   Notify Moderator  
slacker007
Acolyte

Reged: 06/05/04
Posts: 119
Loc: USA, MS
Re: Scripting Help Please! [Re: highpressure]
      #2898805 - 08/07/04 03:29 PM

I don't do much scripting, so im really taking a stab here, but u sound desperate. It seems to me like you want it only to be worn from 6am to 6pm, so if you do you would probably need to say something like if gametime<6 or >18 then (insert the command to unequip the item here).

There. Thats my ingenious idea. Hope it works

--------------------
--------------------
Cogito ergo sum. -Descartes
(I think therefore I am)

Mediocrity:
It takes alot less time and most people don't notice until its too late
-2004 Dispair Calendar

DON'T CONFORM TO ANTI-CONFORMATISM, JUST BE YOURSELF!

Post Extras: Print Post   Remind Me!   Notify Moderator  
highpressure
Curate

Reged: 09/16/02
Posts: 870
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
Re: Scripting Help Please! [Re: slacker007]
      #2899361 - 08/07/04 06:36 PM

I will give that a try. Thanks...any & all help is appreciated!

--------------------
Highpressure's Morrowind
Honoring Mods & Mod-Makers




Post Extras: Print Post   Remind Me!   Notify Moderator  
Miles_Acraeus
Master

Reged: 08/24/02
Posts: 7891
Loc: Primum Mobile
Re: Scripting Help Please! [Re: highpressure]
      #2899362 - 08/07/04 06:37 PM

Well this post is more or less just giving your thread a bump, since this script I just wrote doesn't work. What needs to be done it seems is record the gameHour at the time of equip, and track that over 5-6 hours. Since I don't have any clue as to how to do this, hopefully my post will attract the attention of an experienced scripter to point out my folly, and give you a more difinitive answer.

Code:


Begin AST_Test_Equip

;adjust gameHour if required

Short Temp_Equip
Short OnPcEquip
Short PcSkipEquip
Short Equip_Time

if ( MenuMode == 1 )
return
endif

If ( OnPcEquip == 1 )
set Temp_Equip to 10
set OnPcEquip to 0
endif

if ( Temp_Equip == 10 )
if ( GameHour >= 19 )
if ( GameHour <= 7 )
set PcSkipEquip to 1
MessageBox, "You can't equip this at night."
return
endif


elseif ( GameHour > 7 )
if ( GameHour < 19 )
set Temp_Equip to 20
set OnPcEquip to 0
if ( Temp_Equip == 30 )
set PcSkipEquip to 1
MessageBox, "You can only use this once per day."
endif
endif
endif
endif

if ( Temp_Equip == 20 )

if ( Equip_Time == 0 )
MessageBox, "You Have six hours to wear this item."

set Equip_Time to ( Equip_Time + Gamehour )

elseif ( Equip_Time == ( GameHour + 5 ) )
MessageBox, "Your time has expired."
set PcSkipEquip to 1
set Temp_Equip to 30
endif
endif

end



Of course I only get the message, "You have six hours to wear this item.", with a "rightEval" error, and nothing further happening. Hell, it didn't even recognize the gameHour when I tried to equip it at 11:00 PM.

Someone help this guy out!



--------------------
"Just some spittle in your face." ~ Vladimir Harkonnen



Post Extras: Print Post   Remind Me!   Notify Moderator  
sisco
Curate

Reged: 02/13/03
Posts: 463
Re: Scripting Help Please! [Re: highpressure]
      #2899627 - 08/07/04 07:55 PM

I just altered my script a bit more and just about got it working.

Code:

begin cs_vampire_Dome

short OnPCEquip
short ItemEquipped
short ItemUnequipTime



if ( OnPCEquip == 1 )


if ( MenuMode == 1 )
return
endif
If (PCVampire == 0 ) ; i set this to 0 because i wasn't a vampire when i tested
if ( ItemEquipped == 0 )
set ItemUnequipTime to ( GameHour + 1 ) ; can change number to however many hours you want
MessageBox, "at %g ItemUnequipTime set to %g", GameHour, ItemUnequipTime ; for some reason this didn't display
FadeOut, 0.25
MessageBox "You can now walk beneath the sun's rays with no fear of pain" ; but this did
set ItemEquipped to 1
MessageBox, "Item Equiped"
Player-> RemoveSpell "Vampire sun damage"
MessageBox, "Spell Removed"
FadeIn, 5
endif
endif
if ( GameHour >= ItemUnequipTime )
MessageBox, "Time to Uneguip"
if ( ItemEquipped == 1 ) ;need to add something to unequip the helmet. maybe If you set PCSkipEquip to 1 here the player will unequip it? I'll try it.
FadeOut, 0.25
MessageBox " Beware! The sun's rays will now scorch you"
Player-> AddSpell "Vampire sun damage"
MessageBox, "Spell Added"
set ItemEquipped to 0
set ItemUnequipTime to 0
FadeIn, 5
endif
endif
endif

end



--------------------
my site

Me and my friends need more active members on our forums. it's not morrowind related. just a place for total randomness. Come join and post a lot.

Post Extras: Print Post   Remind Me!   Notify Moderator  
sisco
Curate

Reged: 02/13/03
Posts: 463
Re: Scripting Help Please! [Re: sisco]
      #2899970 - 08/07/04 09:49 PM

It works now.

Code:

begin cs_vampire_Dome

short OnPCEquip
short ItemEquipped
short ItemUnequipTime
Short nextDay
Short Done
short DoOnce

If ( DoOnce == 0 )
set nextDay to Day
set DoOnce to 1
endif

If ( Day == nextDay )
set Done to 0
EndIf

if ( Done == 0 )
if ( OnPCEquip == 1 )


if ( MenuMode == 1 )
return
endif
If (PCVampire == 1 )
if ( ItemEquipped == 0 )
set ItemUnequipTime to ( GameHour + 6 ) ; can change number to however many hours you want
set nextDay to ( Day + 1 ) ; so it can only be used once per day. you can change this so it can be used everyother day or whatever.
FadeOut, 0.25
MessageBox, "You can now walk beneath the sun's rays with no fear of pain"
Player-> RemoveSpell "Vampire sun damage"
set ItemEquipped to 1
FadeIn, 5
endif
endif
if ( GameHour >= ItemUnequipTime )
if ( ItemEquipped == 1 )
FadeOut, 0.25
MessageBox " Beware! The sun's rays will now scorch you"
Player-> AddSpell "Vampire sun damage"
set ItemEquipped to 0
set ItemUnequipTime to 0
set Done to 1
FadeIn, 5
endif
endif
endif
endif

end



--------------------
my site

Me and my friends need more active members on our forums. it's not morrowind related. just a place for total randomness. Come join and post a lot.

Post Extras: Print Post   Remind Me!   Notify Moderator  
highpressure
Curate

Reged: 09/16/02
Posts: 870
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
Re: Scripting Help Please! [Re: sisco]
      #2900369 - 08/07/04 11:34 PM

Sisco my many thanks! To everyone that gave a helping hand with suggestions, I really appreciate it!

I've been at it all day trying to learn this. Now with all the help and info that I got here, I just got a little smarter. This was my first attempt at something with more than 10 lines of script hehehe! so I was a little overwhelmed at first, but refused to give up!

Thanks again for all of the support!

P.S.

Is there a command to damage the item maybe, in order for it to go back into the PC's inventory once the time runs out? Then once it's in the inventory restore the health/condition of said item, and add a PCSkipEquip line so that it can't be equipped until the next morning.



--------------------
Highpressure's Morrowind
Honoring Mods & Mod-Makers




Edited by highpressure (08/08/04 12:36 AM)

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1


Extra information
0 registered and 2 anonymous users are browsing this forum.

Moderator:  Umrahel, Freddo, Pete, Hungry Donner, Attrebus, Miltiades, tegger 

Print Thread

Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 124

Rate this thread
 
Jump to

The Elder Scrolls Homepage

*
UBB.threads™ 6.3

Click for Privacy Statement © 2003 Bethesda Softworks LLC, a ZeniMax Media company. All Rights Reserved.
PRIVACY POLICY | TERMS & CONDITIONS | LEGAL INFORMATION | CONTACT US